package com.relytosoft.mizar.analyze.common.feign;

import com.relytosoft.dubhe.common.core.object.ResponseResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author Jierry
 * @version 2022/5/11.
 */
@Component
public class StrategyFeignFallbackFactory implements FallbackFactory<StrategyFeignService> {
    protected Logger log = LoggerFactory.getLogger(this.getClass());

    @Override
    public StrategyFeignService create(Throwable cause) {
        return new StrategyFeignService() {
            @Override
            public ResponseResult test() {
                log.error("测试");
                return null;
            }

            @Override
            public ResponseResult struFeartureExtraction(String bodys) {
                log.error("结构化图片分析");
                return null;
            }

            @Override
            public ResponseResult faceFeartureExtraction(String bodys) {
                log.error("人脸分析");
                return null;
            }

            @Override
            public ResponseResult faceFeartureComparison(String bodys) {
                log.error("人脸比对1:1");
                return null;
            }

            @Override
            public ResponseResult faceSearch(String bodys) {
                log.error("人脸检索");
                return null;
            }
        };
    }
}
